<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <!-- slides -->
      <swiper-slide v-for="item in list" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl">
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
    list: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      }
      // swiperList: [{
      //   id: '0001',
      //   imgUrl: 'https://img1.qunarzz.com/sight/p0/1606/be/be7426985c756fc7e2.img.jpg_600x330_4dc81148.jpg'
      // }, {
      //   id: '0002',
      //   imgUrl: 'https://img1.qunarzz.com/sight/p0/1412/ad/32a5e0cd8baa07f908eab28e03d5a89f.water.jpg_600x330_353965dc.jpg'
      // }, {
      //   id: '0003',
      //   imgUrl: 'https://img1.qunarzz.com/sight/p0/1603/b5/b55923ced74910b990.water.jpg_600x330_05ff4419.jpg'
      // }]
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet-active{
    background : red !important
  }
 .wrapper{
   overflow : hidden
   width : 100%
   /*height : 31.25vw*/
   //保持宽高比例
   height: 0
   padding-bottom 31.25%
   background-color darkgrey
   .swiper-img{
     width: 100%
   }
 }
</style>
